var trqAnalysisGrid = Ext.create('Ext.tree.Panel', {
    title: '测试需求状态分析',
    useArrows: true,
    rootVisible: false,
    store: analysisGridStore,
    layout: 'fit',
    columns: [{
        xtype: 'treecolumn', // this is so we know which column will show the
        // tree
        text: '测试需求',
        flex: 2,
        dataIndex: 'name'
        // locked: true
    }, {
        // we must use the templateheader component so we can use a custom tpl
        text: "<img src='static/images/icons/fam/delete.gif' style='vertical-align:text-top;'  />未覆盖数",
        flex: 1,
        sortable: true,
        dataIndex: 'notCoveredCount',
        align: 'center',
        renderer: function (value, a, record) {
            if (record.get("leaf"))
                return value == 0 ? "" : "<img src='static/images/icons/fam/delete.gif' style='vertical-align:text-top;'  />";
            else
                return "<strong><span style='color: #e74c3c;font-size: 18px;'>" + value + "</span></strong>";

        }
    }, {
        // we must use the templateheader component so we can use a custom tpl
        text: "<img src='static/images/icons/fam/warning.ico' style='vertical-align:text-top;'  />未执行数",
        flex: 1,
        sortable: true,
        dataIndex: 'notCompletedCount',
        align: 'center',
        renderer: function (value, a, record) {
            if (record.get("leaf"))
                return value == 0 ? "" : "<img src='static/images/icons/fam/warning.ico' style='vertical-align:text-top;'  />";
            else
                return "<strong><span style='color: #ffc40b;font-size: 18px;'>" + value + "</span></strong>";

        }
    }, {
        // we must use the templateheader component so we can use a custom tpl
        text: "<img src='static/images/icons/fam/cross.gif' style='vertical-align:text-top;'  /> 执行失败数",
        flex: 1,
        sortable: true,
        dataIndex: 'failedCount',
        align: 'center',
        renderer: function (value, a, record) {
            if (record.get("leaf"))
                return value == 0 ? "" : "<img src='static/images/icons/fam/cross.gif' style='vertical-align:text-top;'  />";
            else
                return "<strong><span style='color: #ff1028;font-size: 18px;'>" + value + "</span></strong>";

        }
    }, {
        // we must use the templateheader component so we can use a custom tpl
        text: "<img src='static/images/icons/fam/accept.png' style='vertical-align:text-top;'  />执行成功数",
        flex: 1,
        sortable: true,
        dataIndex: 'passCount',
        align: 'center',
        renderer: function (value, a, record) {
            if (record.get("leaf"))
                return value == 0 ? "" : "<img src='static/images/icons/fam/accept.png' style='vertical-align:text-top;'  />";
            else
                return "<strong><span style='color: #0cff6c;font-size: 18px;'>" + value + "</span></strong>";

        }
    }, {
        // we must use the templateheader component so we can use a custom tpl
        text: "<img src='static/images/icons/fam/boom.ico' style='vertical-align:text-top;'  />提交bug数",
        flex: 1,
        sortable: true,
        dataIndex: 'bugCount',
        align: 'center',
        renderer: function (value, a, record) {
            return "<strong><span style='color: #0f0003;font-size: 18px;'>" + value + "</span></strong>";
        }
    }],
    listeners: [{
        beforeitemexpand: function (record, eOpts) {
            if (this.pattern == 1) {//如果是老师和主任的话要这样拿projectId
                var selectArray = classesLeftTreePanel.getSelectionModel().getSelected();// 得到被选择的行的数组.
                var projectId = selectArray.items[0].data.parentId;
                analysisExpendItem(record, projectId);
            } else
                analysisExpendItem(record, currentProjectId);
        }
    }]
});